Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 订单导航栏
    tabs: [{
        key: 0,
        text: '全部'
      },
      {
        key: 1,
        text: '待付款',
        info: ''
      },
      {
        key: 2,
        text: '待上门',
        info: ''
      },
      {
        key: 3,
        text: '已上门',
        info: ''
      },
      {
        key: 4,
        text: '已完成',
        info: ''
      },
    ],
    status: 0,
    value: '',
    orderList: [{
        id: 2,
        orderNumber: '133467574352331',
        flag: true,
        orderStatus: '2',
        shop: [{
          shopName: '日常保洁',
          shopDesc: '日常3小时+空调任选2台',
          shopImg: 'https://pic1.58cdn.com.cn//p1/big/n_v23fe128762a7a4cbeac9b443de19d2760.jpg',
          shopPrice: '99.00',
          shopNumber: '1'
        }],
        button: [{
          type: '',
          title: ''
        }]
      },
      {
        id: 1,
        orderNumber: '1331231231',
        flag: true,
        orderStatus: '2',
        shop: [{
          shopName: '医护上门',
          shopImg: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0615%2F90d55551j00rdiaa5002gc000u000jym.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
          shopDesc: '针灸、推拿点穴等疗法缓解疾病症状',
          shopPrice: '1.00',
          shopNumber: '1'
        }]
      }
    ],
    order: []
  },
  // tab切换
  onTabChange(e) {
    let status = e.detail.value
    if (status == 0) {
      this.setData({
        status,
        order: this.data.orderList
      })
    } else {
      let order = this.data.orderList.filter(item => item.orderStatus == status)
      this.setData({
        status,
        order
      })
    }
  },
  goOrderSearch() {
    wx.navigateTo({
      url: '/pageOrder/order/order-search/index',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      order: this.data.orderList
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})